package com.alex.controller.api;

import com.alex.service.BookService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
public class BookRestAPI {

    @Resource
    private BookService bookService;

    @RequestMapping("/api/rest/book/list")
    public Object getBookList() {
        return bookService.getAll();
    }

    @RequestMapping("/api/rest/book/get/{bid}")
    public Object checkBookId(@PathVariable("bid") String bid) {
        return bookService.get(bid);
    }
}
